<?php
/*
 * 手机客户端店铺-购物车商品删除接口
 * 2014-02-28
 * 2014-05-08 (已查) 
 */
include "inc/public_header.php";

include "func/user.php";				//用户信息处理函数


$reJson = array(); //构建返回值

$goodsId 		= $_REQUEST["goodsId"];		//用户提交内容

//获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0","msg"=>"没有获取到用户信息"));
	die;
}
$uid = $uInfoArr["uid"];//用户信息主键


$sql = "select uid from shop_product_gwc where product_id = '".$goodsId."' and uid='".$uid."'";
$db1->query($sql);
$db1->next_record();
if ($uid != $db1->f("uid")){
	echo json_encode(array("success"=>"0","errCode"=>"-1","msg"=>"该商品已经被删除"));
	die;
}

//购物车商品删除
$sql = "delete from shop_product_gwc where product_id='".$goodsId."' and uid='".$uid."'";
$db->query($sql);
$reJson["success"] = "1";
echo json_encode($reJson);
	
?>
